<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link rel="stylesheet" href="/css/home/home.css" />
        <script type="text/javascript" src="/js/data/main.js"></script>
    </head>
    <body>
        <table id="" cellpadding="0" cellspacing="0" class="mainLayout">
            <tr>
                <td align="left" class="paddingRight10 mainLeftCol" >
                    <table cellpadding="0" cellspacing="0" width="100%" class="paddingLeft10 paddingTop10">
                        <tr>
                            <td colspan="2">
                                <input id="searchbox" type="text" title="Search"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h2><label>Research List</label></h2>
                                <hr />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" id="tdResearchData">
                                <table id="tblRBISResearches" cellpadding="0" cellspacing="0" width="100%">
                                    <?php foreach ($researchList as $research): ?>
                                    <tr class="paddingTop10">
                                        <td class="paddingLeft10" style="padding-top: 10px;">
                                            <span class="mainHeading"><?php echo $research->getTitle(); ?></span>
                                        </td>
                                        <td width="8%" align="right">
                                                <a id="lnkAddUser" href="#" onclick="return loadNewCollaborativeUserDialog(20,400,false,'dlgAddUser', <?php echo $research->getId(); ?>, 'txtRid');">Add User</a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <hr />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table id="tblCollaborativeUsers_<?php echo $research->getId(); ?>" cellpadding="0" cellspacing="0" width="100%">
                                                <?php foreach ($research->getResearchgroup() as $researchGroup): ?>
                                                <tr>
                                                    <td align="center">
                                                        <?php echo Entity::GetEntity( $researchGroup->getCollaborativeentityid())->getFullname(); ?>
                                                    </td>
                                                    <td>
                                                        <a id="lnkRemoveCollaborativeUser" onclick="return removeCollaborativeUser(<?php echo $researchGroup->getCollaborativeentityid(); ?>, <?php echo $research->getId(); ?>);">Remove</a>
                                                    </td>
                                                </tr>
                                                <?php endforeach; ?>
                                            </table>
                                        </td>
                                    </tr>
                                    <?php endforeach; ?>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <a onclick="return showMoreResearches(null, document.getElementById('hfSelectionStatus').value, document.getElementById('chkMineResearch').checked, 'hfSelectionStatus','hfPgNo', false);">more++</a>
                                <input type="hidden" id="hfPgNo" value="1" />
                            </td>
                        </tr>
                    </table>
                    <input id="txtRid" type="hidden"></input>
                    <input type="hidden" id="hfSelectionStatus" value="<?php echo Types::$RESEARCH_STATUS['PUBLISHED']; ?>" />
                </td>
                <td align="left" class="mainRightCol">
                    <table cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td class="paddingLeft10 paddingTop10">
                                <div class="btnResearchSelection">
                                    <a href="<?php echo url_for('data/newResearch'); ?>">New Research</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="underline">
                                <?php include_component('general', 'userProfilePicture', array('userid' => $sf_user->getAttribute('currentuser')->getId())) ?>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div id="boxes">
            <div id="dlgAddUser" class="window">
                <div  class="windowheading" style="width: 390px">
                    <a class="close"><img src="../images/close.png" width="18" height="18" alt="mails"/></a>
                </div>
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr id="trErrorMessage">
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <span>User Name:</span>
                        </td>
                        <td>
                            <input style="width: 90%" type="text" id="txtMailTo" onclick="javascript:LoadUserList();" class="ui-autocomplete-input required"></input>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center">
                            <a id="lnkAddUser" onclick="return addCollaborativeUser(document.getElementById('txtRid').value, $('#txtMailTo').val(), false);">Add User</a>
                        </td>
                        <td>
                            <a class="close">Cancel</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </body>
</html>